#include <iostream>

#include "request.hpp"
#include "response.hpp"
#include "apollo_client.hpp"

using namespace apollo;

int main(void)
{
    ApolloClient client;
    Request request;
    request.setAppId("SampleApp");
    request.setServerUrl("centos201:8080");
    request.setClusterName("default");

    std::cout << "===============PROPERTIES==============" << std::endl;
    request.setNamespace("daq01");
    Response resProperties = client.getProperties(request);
    std::cout << resProperties.getConfiguration() << "\n";

    std::cout << "================TXT=============" << std::endl;
    request.setNamespace("daq02");
    Response resTxt = client.getTxt(request);
    std::cout << resTxt.getConfiguration() << "\n";

    std::cout << "===============JSON==============" << std::endl;
    request.setNamespace("daq03");
    Response resJson = client.getJson(request);
    std::cout << resJson.getConfiguration() << "\n";

    return 0;
}
